<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原生API</title>
</head>

<body>

</body>
<script>
    let date = new Date()
    let strDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDay()
    console.log(strDate)
    let url = 'https://apiv3.shanbay.com/weapps/dailyquote/quote/?date=' + strDate
    // let url = './jquary.html'
    console.log(url)
    function getEveryWord() {
        let xmlhttp = new XMLHttpRequest()
        console.log(XMLHttpRequest.prototype)
        // xmlhttp.onreadystatechange = function () {
        // // if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
        //     // }
        //     console.log(1)
        // }
        
        
        xmlhttp.open('GET', url, true)
        xmlhttp.setRequestHeader('Access-Control-Allow-Origin', '*')
        // xmlhttp.setRequestHeader("Content-Type", 'text/plain');s
        // xmlhttp.setRequestHeader('Cache-Control', 'no-cache')
        // xmlhttp.withCredentials = false
        xmlhttp.send()
    }
    getEveryWord()
</script>

</html>
